TileView for WPF and Silverlight Task-Based Help > Disabling Drag-and-Drop Functionality |
By default drag-and-drop functionality is enabled, allowing users to re-order C1TileViewItem elements at run time. If you choose, however, you can disable drag-and-drop functionality by setting the CanUserReorder property to False.
To disable drag-and-drop functionality in the C1TileView control in the Properties window at design time, complete the following steps:
This disables drag-and-drop functionality.
To disable drag-and-drop functionality in the C1TileView control in XAML, add CanUserReorder="False" to the <c1:TileView> element so that it appears similar to the following:
XAML |
Copy Code
|
---|---|
<c1:C1TileView Name="C1TileView1" CanUserReorder="False"> |
Right-click the window and select View Code to open the Code Editor. Add code to the Window1_Loaded event handler, so it appears similar to the following:
WPF Visual Basic |
Copy Code
|
---|---|
Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded Me.C1TileView1.CanUserReorder = False End Sub |
WPF C# |
Copy Code
|
---|---|
private void Window_Loaded(object sender, RoutedEventArgs e) { this.c1TileView1.CanUserReorder = false; } |
Silverlight Visual Basic |
Copy Code
|
---|---|
Public Sub New() InitializeComponent() Me.C1TileView1.CanUserReorder = False End Sub |
Silverlight C# |
Copy Code
|
---|---|
MainPage(){ InitializeComponent(); this.c1TileView1.CanUserReorder = false; } |
Run your project and observe that now the user cannot perform drag-and-drop operations at run time.